﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>

<% if (Request.IsAuthenticated) { %>
<div>
	<div>
		<div>
			<object type="image/svg+xml" data="http://localhost/web/img?src=<%:User.IsInRole("Admin")?"admin":User.IsInRole("Mod")?"mod":"user"%>"></object>
		</div>
		<div>
			<%:User.Identity.Name %>
		</div>
	</div>
	<div id="Div1" class="menu2">
		<% using (Html.BeginForm("LogOff", "User", FormMethod.Post, new { id = "logoutForm" })) { %>
		<%: Html.AntiForgeryToken() %>
		<% } %>
		<% using (Html.BeginForm("Manage", "User", FormMethod.Post, new { id = "ManageForm" })) { %>
		<%: Html.AntiForgeryToken() %>
		<% } %>
		<div>
			<a href="<%:Url.Action("UserOrder", "Order")%>">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=order"></object>
				</div>
				<div>Order</div>
			</a>
		</div>
		<div>
			<a href="<%:Url.Action("Profile", "User")%>">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=edit_user"></object>
				</div>
				<div>Property</div>
			</a>
		</div>
		<div>
			<a href="javascript:document.getElementById('ManageForm').submit()">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=key"></object>
				</div>
				<div>Security</div>
			</a>
		</div>
		<div>
			<a href="javascript:document.getElementById('logoutForm').submit()">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=logout"></object>
				</div>
				<div>Log Out</div>
			</a>
		</div>
	</div>
</div>
<%} else { %>
<div>
	<div>
		<div>
			<object type="image/svg+xml" data="http://localhost/web/img?src=guest"></object>
		</div>
		<div>
			User
		</div>
	</div>
	<div id="userMenu" class="menu2">
		<div>
			<a href="<%: Url.Action("Login","User") %>">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=login"></object>
				</div>
				<div>Login</div>
			</a>
		</div>
		<div>
			<a href="<%: Url.Action("Register","User") %>">
				<div>
					<object type="image/svg+xml" data="http://localhost/web/img?src=add_user"></object>
				</div>
				<div>Register</div>
			</a>
		</div>
	</div>
</div>
<%} %>